<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="2.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  xmlns:doc="livcos.org/ns/doc"
  xmlns:pm="livcos.org/ns/pm"
  xmlns="http://www.w3.org/1999/xhtml"
  exclude-result-prefixes="doc pm">

	<xsl:template match="pm:task">
		<xsl:variable name="p" select="if (@priority) then @priority else 3"/>
		<div id="{@id}" class="task task_p{$p}">
			<div class="label task_p{$p}_label">
				<xsl:value-of select="if ($p = 1) then 'TODO!' else 'TODO:'"/>
		  </div>
			<xsl:if test="@progress">
				<div class="progress_box">
					<xsl:if test="@progress &gt; 0">
						<div class="progress_bar">
							<xsl:attribute name="style">width:<xsl:value-of select="@progress" />%;</xsl:attribute>
							<xsl:text>&#160;</xsl:text>
						</div>
					</xsl:if>
				</div>
			</xsl:if>
			<p>
				<xsl:value-of select="pm:title"/>
			</p>
			<xsl:apply-templates select="pm:description"/>
		</div>
	</xsl:template>

	<xsl:template match="pm:description">
		<p>
			<xsl:apply-templates select="node()"/>
		</p>
	</xsl:template>

</xsl:stylesheet>
